package com.li.designpattern.composite;

import sun.applet.Main;

public class Test {
	public static void main(String[] args) {
		Company root=new ConcreteCompany("总公司");
		root.add(new FinanceCompany("总公司财务部"));
		root.add(new HRCompany("总公司人力资源部"));
		Company second=new ConcreteCompany("二级分公司");
		second.add(new FinanceCompany("二级财务部"));
		second.add(new HRCompany("二级人力资源部"));
		Company third=new ConcreteCompany("三级分公司");
		third.add(new FinanceCompany("三级财务部"));
		third.add(new HRCompany("三级人力资源部"));
		root.add(second);
		second.add(third);
		root.display(0);
	}
}
